<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 1. 指令:  是Vue封装的标签属性-->
    <!-- 1. v-开头  -->
    <!-- 2. v-xxx="值或表达式" -->
    <!-- 3.  -->
    <div id="app" @click=" message+='~' ">
      <!-- 1. v-html和v-text -->
      <div v-html="content"></div>
      <div v-text="content"></div>

      <!-- 2.  -->
      <h1 v-if="age>18">成年人</h1>
      <h2 v-else>未成年</h2>

      <h1 v-show="age>=18">成年人</h1>
      <h2 v-show="age<18">未成年</h2>
    </div>

    <script src="./vue.js"></script>
    <script>
      // JS中声明变量的方式
      // ES6 :  let  const
      // ES5:   var
      new Vue({
        el: "#app",
        data: {
          message: "Hello Vue!",
          content: "<span>123</span>",
          age: 20,
        },
      });
    </script>
  </body>
</html>
